#ifndef CIMAGEPOOL_H_
#define CIMAGEPOOL_H_

#include <e32base.h>
#include <e32cmn.h>
#include "CImage.h"
#include "ImageLocation.h"

class CImagePool : public CBase
{
public:
	CImagePool();
	virtual ~CImagePool();
	
	static CImagePool* Static()
	{
		if(!iImagePool)
			iImagePool = CImagePool::NewL();
		
		return iImagePool;
	}
	
	static void Release()
		{
		if(iImagePool)
			delete iImagePool;
		}
public:
	static CImagePool* NewL();
	static CImagePool* NewLC();
	
	void ConstructL();
public:
	CImage* Find(const THcImageLocation& aLocation);
	CImage* Add(const THcImageLocation& aLocation);
	
private:
	RArray<CImage*> iImageArray;
	
public:
	static CImagePool* iImagePool;
};

#endif /*CIMAGEPOOL_H_*/
